package com.gegao.somethinginteresting.utils.fresco;

import android.content.Context;

import com.facebook.drawee.view.DraweeView;
import com.gegao.somethinginteresting.utils.fresco.builder.BitMapGetFrescoRequestBuilder;
import com.gegao.somethinginteresting.utils.fresco.builder.GifFrescoRequestBuilder;
import com.gegao.somethinginteresting.utils.fresco.builder.SimpleLoadFrescoRequestBuilder;
import com.gegao.somethinginteresting.utils.fresco.callback.FrescoBitmapCallback;


/**
 * fresco的工具类,链式编程
 * Created by liuchenghui on 2016/01/05.
 */
public class FrescoUtils2 {

    /**
     * 加载图片
     *
     * @param draweeView 需要加载图片的控件
     */
    public static SimpleLoadFrescoRequestBuilder load(DraweeView draweeView) {
        return new SimpleLoadFrescoRequestBuilder(draweeView);
    }

    /**
     * 获取bitmap
     *
     * @param context              上下文
     * @param frescoBitmapCallback bitmap获取的回调
     */
    public static BitMapGetFrescoRequestBuilder getImage(Context context, FrescoBitmapCallback frescoBitmapCallback) {
        return new BitMapGetFrescoRequestBuilder(context, frescoBitmapCallback);
    }

    /**
     * 播放gif
     *
     * @param draweeView 需要加载图片的控件
     */
    public static GifFrescoRequestBuilder playGif(DraweeView draweeView) {
        return new GifFrescoRequestBuilder(draweeView);
    }

}